<template>
  <el-container class="setting-center_company-certication">
    <el-main>
      <div class="card-list">
        <el-row :gutter="40">
          <el-col :xs="18" :md="12" :lg="8" class="list-item-box">
            <div class="list-item clearfix">
              <div class="item-img r-2x fl">
                <img src="../../../assets/settingCenter/mallShopSetting/company.png" alt="">
              </div>
              <div class="item-intro fl">
                <div class="intro-title text-elepsis ng-binding">经营主体认证</div>
                <div class="intro-detail ng-binding">只有经过认证的经营主体才能在本平台开展正常的经营活动</div>
                <div class="image-link-button">
                  <el-button class="image-link-button-button" size="mini" @click="gotoCompanyEntityCertify('',firstType)">{{ authenticationFirst }}</el-button>
                </div>
              </div>
            </div>
          </el-col>
          <el-col :xs="18" :md="12" :lg="8" class="list-item-box">
            <div class="list-item clearfix">
              <div class="item-img r-2x fl">
                <img src="../../../assets/settingCenter/mallShopSetting/bankAcount.png" alt="">
              </div>
              <div class="item-intro fl">
                <p class="intro-title text-elepsis ng-binding">银行账户认证</p>
                <p class="intro-detail ng-binding">经营主体在平台有资金往来，须填写与主体一致的开户银行</p>
                <div class="image-link-button">
                  <el-button class="image-link-button-button" size="mini" @click="gotoBankAccountCertify('',twoType)">{{ authenticationTwo }}</el-button>
                </div>
              </div>
            </div>
          </el-col>
          <el-col :xs="18" :md="12" :lg="8" class="list-item-box">
            <div class="list-item clearfix">
              <div class="item-img r-2x fl">
                <img src="../../../assets/settingCenter/mallShopSetting/tradeMark.png" alt="">
              </div>
              <div class="item-intro fl">
                <p class="intro-title text-elepsis ng-binding">商标授权</p>
                <p class="intro-detail ng-binding">经营主体在平台所有使用的商标必须经过商标所有人授权</p>
                <div class="image-link-button">
                  <el-button class="image-link-button-button" size="mini" @click="gotoTradeMarkCertify('',threeType)">{{ authenticationThree }}</el-button>
                </div>
              </div>
            </div>
          </el-col>
          <!-- </el-row> -->
          <!-- <el-row :gutter="40" class="mb16"> -->
          <el-col :xs="12" :md="12" :lg="8" class="list-item-box">
            <div class="list-item clearfix">
              <div class="item-img r-2x fl">
                <img src="../../../assets/settingCenter/mallShopSetting/brandAuth.png" alt="">
              </div>
              <div class="item-intro fl">
                <p class="intro-title text-elepsis ng-binding">品牌授权</p>
                <p class="intro-detail ng-binding">经营主体在本平台经营的所有商品须经过品牌方授权</p>
                <div class="image-link-button">
                  <el-button class="image-link-button-button" size="mini" @click="gotoBrandAuthCertify('',fourType)">{{ authenticationFour }}</el-button>
                </div>
              </div>
            </div>
          </el-col>
        </el-row>
      </div>
    </el-main>
  </el-container>
</template>

<script>
import { authentication } from '@/api/authentication'
export default {
  components: {

  },
  props: {},
  data() {
    return {
      btnArr: [],
      firstType: 1,
      twoType: '1',
      threeType: '1',
      fourType: '1',
      authenticationFirst: '去认证',
      authenticationTwo: '去认证',
      authenticationThree: '去认证',
      authenticationFour: '去认证'
    }
  },
  computed: {},
  watch: {},
  created() {
    this.getStatus()
  },
  methods: {
    getStatus() {
      authentication().then(res => {
        if (res.enterpriseAuditStatus === 4 || res.enterpriseAuditStatus === 6) {
          this.authenticationFirst = '去查看'
          this.firstType = 2
        }
        if (res.bankAuditStatus === 4 || res.bankAuditStatus === 6) {
          this.authenticationTwo = '去查看'
          this.twoType = 2
        }
        if (res.trademarkAuthAuditStatus === 4 || res.trademarkAuthAuditStatus === 6) {
          this.authenticationThree = '去查看'
          this.threeType = 2
        }
        if (res.brandAuthAuditStatus === 4 || res.brandAuthAuditStatus === 6) {
          this.authenticationFour = '去查看'
          this.fourType = 2
        }
        console.log('res_ss', res)
      })
    },
    gotoCompanyEntityCertify(id, type) {
      this.$router.push(`/companyCertification/companyEntityCertifyStepOne?id=${id}&type=${type}`)
    },
    gotoBankAccountCertify(id, type) {
      this.$router.push(`/companyCertification/bankAccountCertify?id=${id}&type=${type}`)
    },
    gotoTradeMarkCertify(id, type) {
      this.$router.push(`/companyCertification/tradeMarkCertify?id=${id}&type=${type}`)
    },
    gotoBrandAuthCertify(id, type) {
      this.$router.push(`/companyCertification/brandAuthCertify?id=${id}&type=${type}`)
    }
  }
}
</script>
<style lang="scss" scoped>
.setting-center_company-certication{
  min-width: 100%;
  min-height: 100%;
  .mb16{
    margin-top: 20px;
  }
  .card-list{
    margin-top: 15px;
    padding-right: 30px;
    padding-left: 30px;
  }
}
.list-item-box {
  margin-bottom: 20px;
  padding-right: 20px;
  padding-left: 20px;
}

.list-item {
    position: relative;
    border: 2px solid #dddce2;
    border-radius: 4px;
    padding: 20px;
    display: flex;
    height: auto;
    width: 100%;
    .item-img{
      border-radius: 4px;
      margin-top: 20px;
      img {
        width: 65px;
        height: 65px;
      }
    }
    .item-intro{
      padding-left: 20px;
      letter-spacing: 0.5px;
      vertical-align: top;
      float: inherit;
      .intro-title {
        font-size: 14px;
        line-height: 24px;
        color: #595961;
        margin: -4px 0 0;
        font-weight: 700;
        letter-spacing: 1px;
        text-align: center;
      }
      .text-elepsis {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }
      .intro-detail {
        font-size: 12px;
        line-height: 20px;
        color: #9797A1;
        margin: 4px 10px 0;
        text-align: center;
        word-break: break-all;
      }
    }
    .fl{
      float: center;
    }
    .text-elepsis {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      word-wrap: break-word;
    }
}
    .image-link-button {
      padding: 2px 0 0;
      margin-top: 14px;
      margin-right: 40px;
      float: right;
      justify-content: space-between;
      .image-link-button-button{
         background-color: #00aaff;
         z-index: 1;
         color: #FFFFFF;
         height: 32px;
         width: 120px;
         border: 1px solid #FFFFFF;
         padding: 0;
         font-size: 8px;
         align-items: right;
         border-radius: 10px;
      }
    }
</style>
